From 4eebf8ea744818a94399e87307a009d85da3fe0b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 4 Jun 2007 20:33:00 +0000 Subject: [PATCH] (longlines-auto-wrap): Handle argument correctly. --- lisp/longlines.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/longlines.el b/lisp/longlines.el index f39d31e69f0..149f69c9f26 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -368,10 +368,10 @@ Hard newlines are left intact." With optional argument ARG, turn on line wrapping if and only if ARG is positive. If automatic line wrapping is turned on, wrap the entire buffer." (interactive "P") - (and (null arg) - (null longlines-auto-wrap) - (setq arg 1)) - (if (> (prefix-numeric-value arg) 0) + (setq arg (if arg + (> (prefix-numeric-value arg) 0) + (not longlines-auto-wrap))) + (if arg (let ((mod (buffer-modified-p))) (setq longlines-auto-wrap t) (longlines-wrap-region (point-min) (point-max)) -- 2.30.2